package com.gitee.wsl.unit.speed.ext

import com.gitee.wsl.unit.length.LengthUnit
import kotlin.time.Duration
import kotlin.time.DurationUnit

operator fun LengthUnit.times(duration: Duration): LengthUnit{
    val dis = toBase() * duration.toDouble(DurationUnit.SECONDS)
    return if( dis > 1000 )
        LengthUnit.KM(dis/1000)
    else
        LengthUnit.M(dis)
}